const state = {
    list: [],
    page: {},
    typeList: [],
    typePage: {}
}
const actions = {
    allFriends: ({ commit }, payload) => {
        commit('ALLFRIENDS', payload)
    },
    saveType: ({ commit }, payload) => {
        commit('SAVETYPE', payload)
    }
}
const mutations = {
    ALLFRIENDS: (state, payload) => {
        state.list = payload.result.map(item => {
            return {
                ...item,
                paternerTypeId: item.paterner_type_id
            }
        }),
        state.page = {
            size: 10,
            total: payload.resultNum,
            number: payload.number || 1
        }
    },
    SAVETYPE: (state, payload) => {
        state.typeList = payload.result,
        state.typePage = {
            size: 10,
            total: payload.resultNum,
            number: payload.number || 1
        }
    }
}
export default {
    state,
    actions,
    mutations
}